package org.community.loginsvc.service.detailservice;


import entity.CommonResult;
import org.community.loginsvc.config.MultiPartConfig;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Isolation;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

import java.util.Map;

@FeignClient(
        value = "community-user-detail-service",
        configuration = MultiPartConfig.class
)
@Service
@Transactional(
        isolation = Isolation.REPEATABLE_READ
)
//调用用户信息服务的接口类
public interface DetailService {

    @GetMapping(
            value = "/portrait/{userId}/{username}"
    )
    ResponseEntity<byte[]> getUserPortrait(@PathVariable("userId") Integer userId,@PathVariable("username") String username);

    @GetMapping("/userInfo/{userId}/{choice}")
    CommonResult<Map<String,Object>> getUserInfo(@PathVariable("userId") Integer userId,@PathVariable("choice") Integer choice);

}
